package org.example.mapper;

import org.apache.ibatis.annotations.*;
import org.example.pojo.entity.Product;
import org.example.vo.ProductVo1;
import org.example.vo.ProductVo2;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Justin Parker
 * @author 2024/8/3 下午9:59
 * @version 1.0
 */
@Mapper
public interface ProductMapper {

//    @Insert("insert into product(title,price,stock) values(#{title},#{price},#{stock})")
    int insertProduct(Product product);

//    @Update("update product set title=#{title},price=#{price},stock=#{stock} where title=#{title}")
    int updateProduct(Product product);

//    @Delete("delete from product where title=#{title}")
    int deleteProduct(Product product);

//    @Select("select * from product where title=#{title}")
    List<ProductVo1> selectProduct();

    ProductVo2 selectProductByID(Integer id);

    int deleteByIds(List<Integer> id);

    int dynamicUpdate(Product product);

    int selectCount();


}
